import { useSelector, useDispatch } from 'react-redux';
export function useNotice() {
  const uid = useSelector((state) => state.notice.uid);
  const username = useSelector((state) => state.notice.username);
  let $dispatch = useDispatch();
  const setUsername = (username) => {
    console.log(username);
    $dispatch({
      type: 'notice/setUsername',
      value: username,
    });
  };
  const setUid = (uid) => {
    console.log(uid);
    $dispatch({
      type: 'notice/setUid',
      value: uid,
    });
  };
  return { uid, username, setUsername, setUid };
}
